import axios from '@/libs/api.request'

export const fileList = (env, fileType, child_type, page, pageSize, searchValue) => {
  const params = {
    'env': env,
    'file_type': fileType,
    'child_type': child_type,
    'Page': page,
    'PageSize': pageSize,
    'search': searchValue
  }
  return axios.request({
    url: 'files/',
    params,
    method: 'get'
  })
}

export const fileAllSearch = (env, fileType, child_type, searchValue) => {
  const params = {
    'env': env,
    'file_type': fileType,
    'child_type': child_type,
    'search': searchValue
  }
  return axios.request({
    url: 'files/',
    params,
    method: 'get'
  })
}

export const deleteFile = (id) => {
  return axios.request({
    url: `files/${id}/`,
    method: 'delete'
  })
}
